            var myDate = new Date();//添加日期
           	y=myDate.getFullYear(); 
           	m=myDate.getMonth()+1;
           	d=myDate.getDate()-1;
           	if(myDate.getDate()==1){
           		 d=myDate.getDate();
           	}
           	dqy=y+"-"+m+"-"+d;
           	$('#reservation').val(dqy+" - "+dqy)
               $(document).ready(function() {
                  $('#reservation').daterangepicker({
                        // startDate: moment().startOf('day'),  
                        //endDate: moment(),  
                        //minDate: '01/01/2012',    //最小时间  
                        maxDate : moment(), //最大时间   
                        dateLimit : {  
                            days : 60  
                        }, //起止时间的最大间隔  
                        showDropdowns : true,  
                        showWeekNumbers : false, //是否显示第几周  
                        timePicker : false, //是否显示小时和分钟  
                        timePickerIncrement : 60, //时间的增量，单位为分钟  
                        timePicker12Hour : false, //是否使用12小时制来显示时间  
                        ranges : {  
                            //'最近1小时': [moment().subtract('hours',1), moment()],  
                            '昨日': [moment().subtract('days', 1).startOf('day'), moment().subtract('days', 1).endOf('day')],
                            '最近7日': [moment().subtract('days', 6), moment()],
                            '最近30日': [moment().subtract('days', 29), moment()],  
                            '最近60日': [moment().subtract('days', 59), moment()]  
                        },  
                        opens : 'right', //日期选择框的弹出位置  
                        buttonClasses : [ 'btn btn-default' ],  
                        applyClass : 'btn-small btn-primary blue',  
                        cancelClass : 'btn-small',  
                        format : 'YYYY-MM-DD', //控件中from和to 显示的日期格式  
                        separator : ' - ',  
                        locale : {  
                            applyLabel : '确定',  
                            cancelLabel : '取消',  
                            fromLabel : '从',  
                            toLabel : '到',  
                            weekLabel: 'W',
                            customRangeLabel : '选择时间',  
                            daysOfWeek : [ '日', '一', '二', '三', '四', '五', '六' ],  
                            monthNames : [ '一月', '二月', '三月', '四月', '五月', '六月',  
                                    '七月', '八月', '九月', '十月', '十一月', '十二月' ]
//                          firstDay : 1  
                        }  
                    }, function(start, end, label) {//格式化日期显示框  
                        $('#reservation span').html(start.format('YYYY-MM-DD') + ' - ' + end.format('YYYY-MM-DD'));  
                    }); 
					
               });
           $(document).on('click','.applyBtn',function(){//判断日期是否是在60天之内
           	     var val=$('#reservation').val().split(' - ');
              	 var endTime=new Date(val[1]);
              	 var startTime=new Date(val[0]);
              	if(endTime - startTime>5270400000){
              		$('.daterangepicker').css('display','block')
              		 G_Prg.alert('每次最多选取60天',function(){
	
                    });
              	}
           })
        var clients = [];
        var clientsName = [];
		var hTimes = ["0点","1点","2点","3点","4点","5点","6点","7点","8点","9点",
    				"10点","11点","12点","13点","14点","15点","16点","17点","18点","19点",
    				"20点","21点","22点","23点"
    				];
		var hwChart;
		var swChart;
		var times=[];//两个日期之间的区间
		var menuData1 = G_Prg.getSoftMenuData().Childs[0];
		var menuData2 = G_Prg.getSoftMenuData().Childs[1];
		var appenames = '';
        this.init = function(){
            var option = {};
            var dd=new Date();
            var m=dd.getMonth()+1;
            var d1=dd.getDate();
            //var d2=dd.getDate();
            var days1=G_Prg.GetDay(dd.getFullYear(),m,d1);
            var days2=  dd.getFullYear()+'-'+m+'-'+d1;
            $('#logmin').val(days1);
            $('#logmax').val(days1);
            allclick();//点击事件

        }
        /**************************************************
         * 功能：点击事件
         * 函数名：allclick（）
         * 传入参数：无
         * 创建人：刘淳昊 2017-03-13
         *************************************************/
        function allclick() {
            //刷新页面
            $('.refresh').on('click',function(){
                window.location.reload();
            })
            //1.所有功能选择
            $('.selectionL span').on('click',function(){
				   if($(this).hasClass('selected')){
                       $(this).removeClass('selected');
                   }else{
                       $(this).addClass('selected').siblings().removeClass('selected');
                   }
            })
            //2.切换情况选项
            $('.purchase-situation span').on('click',function(){
                if($(this).hasClass('selected')){
                    $(this).removeClass('selected');
                }else{
                    $(this).addClass('selected').siblings().removeClass('selected');
                }
            })
            //3.1科目分层选择
            $('.productOne div').on('click',function(event){
        	    var liHeight=$('.productOne li span').length*34+'px';
        	    event.stopPropagation();
        		if($('.productOne li').css('height')=='1px'||$('.productOne li').css('height')=='0px'){
        			$('.productOne li').css({'border':'1px solid #e0e0e0','border-top':'none','height':liHeight});
        			$('.productOne div img').attr('src','../../img/packUp.png');
        			if($('.productOne li span').length>=6){
	    		      $('.productOne li').css({'overflow-y':'scroll','height':6*34+'px'})
	    			}
        		}else{
        		    $('.productOne li').css({'height':'0px','border':'1px solid #fff','border-top':'none'});
        		    $('.productOne div img').attr('src','../../img/spread.png');
        		}
        	})
        	$('.productOne li span').on('click',function(event){
        		event.stopPropagation();
        		$('.productOne div p').attr('id',$(this).attr('id'));
        	    $('.productOne div p').html($(this).html());
        	    $('.productOne li').css({'height':'0px','border':'1px solid #fff','border-top':'none'});
        		$('.productOne div img').attr('src','../../img/spread.png');
        		$('.productThree,.three,.four,.productFour').css({'display':'none'})
        		$('.productTwo div p').html('--');
        		//第一层的目录列表选择
        	    removeSession();//清除session 
        		switch($('.productOne div p').html()){
					case '医学高级':
						$('.productTwo li').empty();
						addData(_getAppMenuData(8001));//传送数据
						break;
					case '主治医师':
						$('.productTwo li').empty();
						addData(_getAppMenuData(8002));//传送数据
						break;
					case '主治中医':
						$('.productTwo li').empty();
						addData(_getAppMenuData(8003));//传送数据
						break;
					case '护理考试':
						$('.productTwo li').empty();
						addData(_getAppMenuData(8004));//传送数据
						break;
					case '住院医师':
						$('.productTwo li').empty();
						addData(_getAppMenuData(8005));//传送数据
						break;
					case '执业医师':
						$('.productTwo li').empty();
						addData(_getAppMenuData(8006));//传送数据
						break;
					case '医技考试':
						$('.productTwo li').empty();
						addData(_getAppMenuData(8007));//传送数据
						break;
					case '药学职称':
						$('.productTwo li').empty();
						addData(_getAppMenuData(8008));//传送数据
						break;
					case '执业药师':
						$('.productTwo li').empty();
						addData(_getAppMenuData(8009));//传送数据
						break;
					case '新版考试宝典':
						$('.productTwo li').empty();
						addData(_getAppMenuData(888));//传送数据
						break;
					case '医学':
						$('.productTwo li').empty();
						addData(_getAppMenuData(8010));//传送数据
						break;
					case '内科主治医师':
						$('.productTwo li').empty();
						addData(_getAppMenuData(8011));//传送数据
						break;
					case '内科高级职称':
						$('.productTwo li').empty();
						addData(_getAppMenuData(8012));//传送数据
						break;	
					case '外科主治医师':
						$('.productTwo li').empty();
						addData(_getAppMenuData(8013));//传送数据
						break;
					case '外科高级职称':
						$('.productTwo li').empty();
						addData(_getAppMenuData(8014));//传送数据
						break;
					case '主管护师':
						$('.productTwo li').empty();
						addData(_getAppMenuData(8015));//传送数据
						break;
					case '初级护师':
						$('.productTwo li').empty();
						addData(_getAppMenuData(8016));//传送数据
						break;
					case '医学中级职称':
						$('.productTwo li').empty();
						addData(_getAppMenuData(8017));//传送数据
						break;
					case '护理高级职称':
						$('.productTwo li').empty();
						addData(_getAppMenuData(8018));//传送数据
						break;
					case '技师(士)初级':
						$('.productTwo li').empty();
						addData(_getAppMenuData(8019));//传送数据
						break;
					case '技师中级职称':
						$('.productTwo li').empty();
						addData(_getAppMenuData(8020));//传送数据
						break;
					case '技师高级职称':
						$('.productTwo li').empty();
						addData(_getAppMenuData(8021));//传送数据
						break;
			    }
        	})
			//3.2科目分层选择
	        $(document).on('click','.productTwo div',function(event){
	    		event.stopPropagation();
	    	    zhang(this);
	    	})
	        //3.3目录列表
	        $(document).on('click','.productThree div',function(event){
	    		event.stopPropagation();
	    	    zhang(this);
	    	})
	        //4.4最后一层目录列表
	        $(document).on('click','.productFour div',function(event){
	    		event.stopPropagation();
	    	    zhang(this);
	    	})
	        $(document).on('click','.productTwo li span',function(event){
	    		event.stopPropagation();
			    xuanze(this);
		    })  
	        $(document).on('click','.productThree li span',function(event){
	    		event.stopPropagation();
			    xuanze(this);
	    	})
	         $(document).on('click','.productFour li span',function(event){
	    		event.stopPropagation();
			    xuanze(this);
	    	})
	        //查询结果
	        $('#btncx').on('click',function(){
	            if($('.productFour').css('display') == 'block' && $('.productFour div>p').html() != '--'){
	        	     appenames = $('.productFour div>p').attr('appEname');
	        	}else if($('.productThree').css('display') == 'block' && $('.productThree div>p').html() != '--' && $('.productFour').css('display') == 'none'){
	        		 appenames = $('.productThree div>p').attr('appEname');
	        	}else if($('.productTwo').css('display') == 'block' && $('.productTwo div>p').html() != '--' && $('.productThree').css('display') == 'none'){
	        		 appenames = $('.productTwo div>p').attr('appEname');
	        	}else{
	        		G_Prg.alert('请选择科目再去查询！')
	        	    return;
	        	}
//	        	if($('.productThree').css('display') == 'none'){
//	        		G_Prg.alert('请选择科目再去查询！')
//	        	}else {
	        		var val=$('#reservation').val().split(' - ');
		            var startTime=new Date(val[0]);
		            var endTime=new Date(val[1]);
		            if(endTime-startTime<5270400000){
		                $('.loadingimg').show();
		            	$('.panel-body,.panel-body2,.panel-body3,.panel-body4,.panel-body5').hide();
		            	setTimeout(function(){
		            	$('.panel-body,.panel-body2,.panel-body3,.panel-body4,.panel-body5').show();
		                    getLoginData();
		                    window.onresize = function () {
						        swChart.resize();
						    }
		            	},500)
		            }else{
		           		G_Prg.alert('每次最多选取60天');
		            }
//	        	}
	            
	        })
        }
        function removeSession(){
	            sessionStorage.removeItem('8001_AppMenuData');
            	sessionStorage.removeItem('8002_AppMenuData');
            	sessionStorage.removeItem('8003_AppMenuData');
            	sessionStorage.removeItem('8004_AppMenuData');
            	sessionStorage.removeItem('8005_AppMenuData');
            	sessionStorage.removeItem('8006_AppMenuData');
            	sessionStorage.removeItem('8007_AppMenuData');
            	sessionStorage.removeItem('8008_AppMenuData');
            	sessionStorage.removeItem('8009_AppMenuData');
            	sessionStorage.removeItem('8010_AppMenuData');
            	sessionStorage.removeItem('8011_AppMenuData');
            	sessionStorage.removeItem('8012_AppMenuData');
            	sessionStorage.removeItem('8013_AppMenuData');
            	sessionStorage.removeItem('8014_AppMenuData');
            	sessionStorage.removeItem('8015_AppMenuData');
            	sessionStorage.removeItem('8016_AppMenuData');
            	sessionStorage.removeItem('8017_AppMenuData');
            	sessionStorage.removeItem('8018_AppMenuData');
            	sessionStorage.removeItem('8019_AppMenuData');
            	sessionStorage.removeItem('8020_AppMenuData');
            	sessionStorage.removeItem('8021_AppMenuData');
            	sessionStorage.removeItem('AppMenuData');
        }
        //第二层的目录列表
        function addData(menuData){
        	var menuChild = menuData.Childs;
//      	if(menuChild.length <= 1){
//      	    var menuChild = menuChild[0].Childs;
//      	}
        	var ulist ='';
        	for(var i=0;i<menuChild.length;i++){
        		if($('.productOne p').html() == '住院医师'){
        		  var lastMenu =menuChild[0].Childs;  
                  for(var j=0;j<lastMenu.length;j++){
			    	ulist = '<span id="'+j+'" appEname='+lastMenu[j].AppEName+'>'+lastMenu[j].Name+'</span>';
			    	$('.productTwo li').append(ulist);
			      }	
			      if(menuData){menuClick(menuChild)}	
			      return;
        		}
	        	if(menuChild.length <= 1){
	        	  var lastMenu =menuChild[0].Childs;  
	        	  $('.productTwo div p').html(menuChild[0].Name);
			      $('.productTwo div p').attr('appEname',menuChild[0].AppEName);
                  for(var j=0;j<lastMenu.length;j++){
			    	ulist = '<span id='+null+' appEname='+lastMenu[j].AppENames[1]+'>'+lastMenu[j].Name+'</span>';
			    	$('.productTwo li').append(ulist);
			      }	
			    }else{
			    	$('.productTwo div p').html(menuChild[0].Name);
			    	$('.productTwo div p').attr('appEname',menuChild[0].AppEName);
			    	ulist = '<span id="'+i+'" appEname='+menuChild[i].AppEName+'>'+menuChild[i].Name+'</span>';
			    	$('.productTwo li').append(ulist);
			    }
			    if(menuData){menuClick(menuChild)}	
        	}
        	$('.productTwo div p').html('--');
        }  	
        //第三层列表展示
        function menuClick(menuChild){
        	$('.productTwo li span').unbind('click').click(function(event){   
        		var curIndex = $(this).attr('id');
        		$('.productThree li').empty();	
        		if($('.productOne p').html() == '住院医师'){
        		  var lastMenu2 =menuChild[0].Childs[curIndex].Childs;  
                  for(var j=0;j<lastMenu2.length;j++){
			    	ulist = '<span id='+j+' appEname='+lastMenu2[j].AppEName+'>'+lastMenu2[j].Name+'</span>';
			    	$('.productThree li').append(ulist);
			      }	
			      $('.three').css('display','block');
			      $('.productThree').css('display','block');
        		}else{
        			var lastMenu = menuChild[curIndex].Childs;
	        		for(var i=0;i<lastMenu.length;i++){
	        			$('.productThree div p').attr('appEname',lastMenu[0].AppEName);
	        			$('.productThree div p').html(lastMenu[0].Name);
				    	ulist = '<span id="'+i+'" appEname='+lastMenu[i].AppEName+'>'+lastMenu[i].Name+'</span>';
				    	$('.three').css('display','block');
				    	$('.productThree').css('display','block');
				    	$('.productThree li').append(ulist);
	        		}
	        		if(lastMenu){
	        			menuClick2(menuChild[curIndex].Childs)
	        		}
        		}
        		event.stopPropagation();
			    $('.productTwo div p').html($(this).html());
			    $('.productTwo div p').attr('id',$(this).attr('id'));
			    $('.productTwo li').css({'height':'0px','border':'1px solid #fff','border-top':'none'});
				$('.productTwo div img').attr('src','../../img/spread.png');
        		$('.four,.productFour').css({'display':'none'})
        	    $('.productThree div p').html('--');
        	})
        }
        //第四层列表展示
        function menuClick2(menuChilds){
        	$('.productThree li span').unbind('click').click(function(event){
        		var curIndex = $(this).attr('id');
        		var lastMenu =menuChilds[curIndex].Childs;
        		$('.productFour li').empty();
        		if(menuChilds[curIndex].Childs != null){
	        		for(var i=0;i<lastMenu.length;i++){
	        			$('.productFour div p').attr('appEname',lastMenu[0].AppEName);
	        			$('.productFour div p').html(lastMenu[0].Name);
				    	ulist = '<span id="'+i+'" appEname='+lastMenu[i].AppENames[0]+'>'+lastMenu[i].Name+'</span>';
				    	$('.four').css('display','block');
				    	$('.productFour').css('display','block');
				    	$('.productFour li').append(ulist);
	        		}
	        		event.stopPropagation();
				    $('.productThree div p').html($(this).html());
				    $('.productThree div p').attr('id',$(this).attr('id'));
				    $('.productThree li').css({'height':'0px','border':'1px solid #fff','border-top':'none'});
					$('.productThree div img').attr('src','../../img/spread.png');		
        	        $('.productFour div p').html('--');
        		}
        		
        	})
        }
           /**************************************************
             * 功能：数据绘图
             * 函数名：Canvas1（）
             * 传入参数：无
             * 创建人：刘淳昊 2017-03-30
             *************************************************/
            function Canvas1(jsonData,times,listData){
                var series =[];
                var xAxis =[];
                var btn=[]
                var lineData2=listData.split(',');
                for(var i =0;i<jsonData.length;i++){
            		btn.push(jsonData[i].btnName)
            	}
                console.log(jsonData,lineData2,listData)
                var StyleSin = function(){
                    return {
                        data:[],
                        axisLabel: {
							show: true,
							textStyle: {
								color: '#000',
								fontFamily: "microsoft yahei",
								fontSize: 12
							}
						}
                    }
                };
                var Item = function(){
                    return {
                        name:'',
                        type:'line',
                        itemStyle: {normal: {}},
                        label: {normal: {}},
                        data:[]
                    }
                };
				//x轴分为两种情况 （1.0-23小时  2.时间日期 xxxx-xx-xx）
                for(var i =0;i<jsonData.length;i++){
                    if(times.length>=1){
                        var it = new Item();
                        var style = new StyleSin();
                        it.name = jsonData[i].btnName;
                        it.type = 'line';
                        it.data = jsonData[i].data.split(',');
                        style.data = times;
                        style.type = 'category';
                        style.boundaryGap = false;
                        style.name='(时间)';
                        series.push(it);// 将item放在series中
                        xAxis.push(style);
                    }
                }
                // 基于准备好的dom，初始化echarts实例
                 swChart = echarts.init(document.getElementById('main'));
                // 指定图表的配置项和数据
                option = {
                    title: {
                    	x:'20',
                        text: ''
                    },
                    tooltip:{
                        trigger: 'axis'
                    },
                    legend:{
                        data:btn
                    },
                     grid: {
				        left: '2%',
				        bottom: '0%',
				        containLabel: true
				    },
                    yAxis: {
                        type : 'value'
                    },
                    series: []
                };
                option.series = series;
                option.xAxis = [{  //修改上面的日期
             	   axisLabel:{show:true},
	               textStyle:{color:"#000",fontFamily:"microsoft yahei",fontSize:12},
	               boundaryGap:false,
	               name:"(时间)",
	               type:"category",
                   data:xAxis[0].data
              }];
                // 使用刚指定的配置项和数据显示图表。
                swChart.setOption(option);
            }
             
             
             /**************************************************
             * 功能：数据绘图(饼状图)
             * 函数名：Canvas2（）
             * 传入参数：无
             * 创建人：刘淳昊 2017-03-30
             *************************************************/
            function Canvas2(jsonData,clientsName){
               var btn=[];
               var zhuData=[];
               for(var i=0;i<jsonData.length;i++){
               	     btn.push(jsonData[i].btnName);
               	     zhuData.push(jsonData[i].count);
               }
               hwChart = echarts.init(document.getElementById('main1'));
				var app = {};
				var option = null;
				app.title = '坐标轴刻度与标签对齐';
				option = {
				    color: ['#3398DB'],
				    tooltip : {
				        trigger: 'axis',
				        axisPointer : {            // 坐标轴指示器，坐标轴触发有效
				            type : 'shadow'        // 默认为直线，可选为：'line' | 'shadow'
				        }
				    },
				    legend: {
			             data:['访问量']
			        },
				    grid: {
				        left: '3%',
				        right: '4%',
				        bottom: '3%',
				        containLabel: true
				    },
				    xAxis : [
				        {
				            type : 'category',
				            data : btn,
				            axisTick: {
				                alignWithLabel: true
				            }
				        }
				    ],
				    yAxis : [
				        {
				            type : 'value'
				        }
				    ],
				    series : [
				        {
				            name:["访问量"],
				            type:'bar',
				            barWidth: '60%',
				            data:zhuData,
				            itemStyle: {
				                normal: {
				                    color: function(params) {
				                        // build a color map as your need.
				                        var colorList = [
				                          '#C1232B','#B5C334','#FCCE10','#E87C25','#27727B'
				                        ];
				                        return colorList[params.dataIndex]
				                    }
				                }
				            },
				            label:{ 
				                normal:{ 
				                    show: true, 
				                    position: 'top'
				                    }
				            }
				        }
				    ]
				};
				 
				 
				if (option && typeof option === "object") {
				    hwChart.setOption(option, true);
            }
           }
             /**************************************************
             * 功能：数据绘图(饼状图)
             * 函数名：Canvas3（）
             * 传入参数：无
             * 创建人：韩富攀 2017-10-24
             *************************************************/
        function Canvas3(jsonData,clientsName){ 	
        	   var btn=[];
               var zhuData=[];
               for(var i=0;i<jsonData.length;i++){
               	     btn.push(jsonData[i].chapter);
               	     zhuData.push(jsonData[i].count);
               } 
                hwChart = echarts.init(document.getElementById('main2'));
				var app = {};
				var option = null;
				app.title = '坐标轴刻度与标签对齐';
				option = {
				    color: ['#3398DB'],
				    tooltip : {
				        trigger: 'axis',
				        axisPointer : {            // 坐标轴指示器，坐标轴触发有效
				            type : 'shadow'        // 默认为直线，可选为：'line' | 'shadow'
				        }
				    },
				    legend: {
			             data:['访问量']
			       },
				    dataZoom: [
					{
						type: 'slider',
						show: true,
						realtime: true,
						xAxisIndex: [0],
						start: 0,
						end: 60
					},{
						type: 'inside',
						xAxisIndex: [0],
						start: 0,
						end: 60
					},
					],
				    grid: {
				        left: '3%',
				        right: '4%',
				        bottom: '12%',
				        containLabel: true
				    },
				    xAxis : [
				        {
				            type : 'category',
				            data : btn,
				            axisTick: {
				                alignWithLabel: true
				            }
				        }
				    ],
				    yAxis : [
				        {
				            type : 'value'
				        }
				    ],
				    series : [
				        {
				            name:["访问量"],
				            type:'bar',
				            barWidth: '60%',
				            data:zhuData,
				            itemStyle: {
				                normal: {
				                    color: function(params) {
				                        // build a color map as your need.
				                        var colorList = [
				                          '#C1232B','#B5C334','#FCCE10','#E87C25','#27727B'
				                        ];
				                        return colorList[params.dataIndex]
				                    }
				                }
				            },
				            label:{ 
				                normal:{ 
				                    show: true, 
				                    position: 'top'
				                    }
				            }
				        }
				    ]
				};
				 
				if (option && typeof option === "object") {
				    hwChart.setOption(option, true);
            }
           }
             /**************************************************
             * 功能：数据绘图(饼状图)
             * 函数名： Canvas4()
             * 传入参数：无
             * 创建人：韩富攀 2017-10-24
             *************************************************/ 
        function Canvas4(jsonData,clientsName){
               var btn=[];
               var zhuData=[];
               for(var i=0;i<jsonData.length;i++){
               	     btn.push(jsonData[i].chapter);
               	     zhuData.push(jsonData[i].count);
               } 
               hwChart = echarts.init(document.getElementById('main3'));
				var app = {};
				var option = null;
				app.title = '坐标轴刻度与标签对齐';
				option = {
				    color: ['#3398DB'],
				    tooltip : {
				        trigger: 'axis',
				        axisPointer : {            // 坐标轴指示器，坐标轴触发有效
				            type : 'shadow'        // 默认为直线，可选为：'line' | 'shadow'
				        }
				    },
				    legend: {
			             data:['访问量']
			       },
				    dataZoom: [
						{
							type: 'slider',
							show: true,
							realtime: true,
							xAxisIndex: [0],
							start: 0,
							end: 30,
							height: 25
							
						},{
							type: 'inside',
							xAxisIndex: [0],
							start: 0,
							end: 30
						},
					],
				    grid: {
				        left: '3%',
				        right: '4%',
				        bottom: '15%',
				        containLabel: true
				    },
				    xAxis : [
				        {
				            type : 'category',
				            data : btn,
				            axisTick: {
				                alignWithLabel: true
				            }
				        }
				    ],
				    yAxis : [
				        {
				            type : 'value'
				        }
				    ],
				    series : [
				        {
				            name:["访问量"],
				            type:'bar',
				            barWidth: '60%',
				            data:zhuData,
				            itemStyle: {
				                normal: {
				                    color: function(params) {
				                        // build a color map as your need.
				                        var colorList = [
				                          '#C1232B','#B5C334','#FCCE10','#E87C25','#27727B'
				                        ];
				                        return colorList[params.dataIndex]
				                    }
				                }
				            },
				            label:{ 
				                normal:{ 
				                    show: false, 
				                    position: 'top'
				                    }
				            }
				        }
				    ]
				};
				 
				 
				if (option && typeof option === "object") {
				    hwChart.setOption(option, true);
            }
           }
                     /**************************************************
             * 功能：数据绘图(饼状图)
             * 函数名：Canvas3（）
             * 传入参数：无
             * 创建人：韩富攀 2017-10-24
             *************************************************/
        function Canvas5(jsonData,clientsName){
        	   var btn=[];
               var zhuData=[];
               for(var i=0;i<jsonData.length;i++){
               	     btn.push(jsonData[i].chapter);
               	     zhuData.push(jsonData[i].score);
               } 
               hwChart = echarts.init(document.getElementById('main4'));
				var app = {};
				var option = null;
				app.title = '坐标轴刻度与标签对齐';
				option = {
				    color: ['#3398DB'],
				    tooltip : {
				        trigger: 'axis',
				        axisPointer : {            // 坐标轴指示器，坐标轴触发有效
				            type : 'shadow'        // 默认为直线，可选为：'line' | 'shadow'
				        }
				    },
				    legend: {
			             data:['访问量']
			       },
				    dataZoom: [
					{
						type: 'slider',
						show: true,
						realtime: true,
						xAxisIndex: [0],
						start: 0,
						end: 60
					},{
						type: 'inside',
						xAxisIndex: [0],
						start: 0,
						end: 60
					},
					],
				    grid: {
				        left: '3%',
				        right: '4%',
				        bottom: '12%',
				        containLabel: true
				    },
				    xAxis : [
				        {
				            type : 'category',
				            data : btn,
				            axisTick: {
				                alignWithLabel: true
				            }
				        }
				    ],
				    yAxis : [
				        {
				            type : 'value'
				        }
				    ],
				    series : [
				        {
				            name:["访问量"],
				            type:'bar',
				            barWidth: '60%',
				            data:zhuData,
				            itemStyle: {
				                normal: {
				                    color: function(params) {
				                        // build a color map as your need.
				                        var colorList = [
				                          '#C1232B','#B5C334','#FCCE10','#E87C25','#27727B'
				                        ];
				                        return colorList[params.dataIndex]
				                    }
				                }
				            },
				            label:{ 
				                normal:{ 
				                    show: true, 
				                    position: 'top'
				                    }
				            }
				        }
				    ]
				};
				 
				 
				if (option && typeof option === "object") {
				    hwChart.setOption(option, true);
            }
           }
            /**************************************************
             * 功能：数据绘图(饼状图)
             * 函数名：Canvas3（）
             * 传入参数：无
             * 创建人：韩富攀 2017-10-24
             *************************************************/
        function Canvas5s(jsonData,clientsName){
        	   var btn=[];
               var zhuData=[];
               for(var i=0;i<jsonData.length;i++){
               	     btn.push(jsonData[i].chapter);
               	     zhuData.push(jsonData[i].count);
               } 
               hwChart = echarts.init(document.getElementById('main4s'));
				var app = {};
				var option = null;
				app.title = '坐标轴刻度与标签对齐';
				option = {
				    color: ['#3398DB'],
				    tooltip : {
				        trigger: 'axis',
				        axisPointer : {            // 坐标轴指示器，坐标轴触发有效
				            type : 'shadow'        // 默认为直线，可选为：'line' | 'shadow'
				        }
				    },
				    legend: {
			             data:['访问量']
			       },
				    dataZoom: [
					{
						type: 'slider',
						show: true,
						realtime: true,
						xAxisIndex: [0],
						start: 0,
						end: 60
					},{
						type: 'inside',
						xAxisIndex: [0],
						start: 0,
						end: 60
					},
					],
				    grid: {
				        left: '3%',
				        right: '4%',
				        bottom: '12%',
				        containLabel: true
				    },
				    xAxis : [
				        {
				            type : 'category',
				            data : btn,
				            axisTick: {
				                alignWithLabel: true
				            }
				        }
				    ],
				    yAxis : [
				        {
				            type : 'value'
				        }
				    ],
				    series : [
				        {
				            name:["访问量"],
				            type:'bar',
				            barWidth: '60%',
				            data:zhuData,
				            itemStyle: {
				                normal: {
				                    color: function(params) {
				                        // build a color map as your need.
				                        var colorList = [
				                          '#C1232B','#B5C334','#FCCE10','#E87C25','#27727B'
				                        ];
				                        return colorList[params.dataIndex]
				                    }
				                }
				            },
				            label:{ 
				                normal:{ 
				                    show: true, 
				                    position: 'top'
				                    }
				            }
				        }
				    ]
				};
				 
				 
				if (option && typeof option === "object") {
				    hwChart.setOption(option, true);
            }
           }
            /**************************************************
             * 功能：数据绘图(饼状图)
             * 函数名：Canvas3（）
             * 传入参数：无
             * 创建人：韩富攀 2017-10-24
             *************************************************/
        function Canvas6(jsonData,clientsName){
        	   var btn=[];
               var zhuData=[];
               for(var i=0;i<jsonData.length;i++){
               	     btn.push(jsonData[i].chapter);
               	     zhuData.push(jsonData[i].count);
               } 
               hwChart = echarts.init(document.querySelector('.main421'));
				var app = {};
				var option = null;
				app.title = '坐标轴刻度与标签对齐';
				option = {
				    color: ['#3398DB'],
				    tooltip : {
				        trigger: 'axis',
				        axisPointer : {            // 坐标轴指示器，坐标轴触发有效
				            type : 'shadow'        // 默认为直线，可选为：'line' | 'shadow'
				        }
				    },
				    legend: {
			             data:[]
			       },
				    dataZoom: [
					{
						type: 'slider',
						show: true,
						realtime: true,
						xAxisIndex: [0],
						start: 0,
						end: 60
					},{
						type: 'inside',
						xAxisIndex: [0],
						start: 0,
						end: 60
					},
					],
				    grid: {
				        left: '3%',
				        right: '4%',
				        bottom: '12%',
				        containLabel: true
				    },
				    xAxis : [
				        {
				            type : 'category',
				            data : btn,
				            axisTick: {
				                alignWithLabel: true
				            }
				        }
				    ],
				    yAxis : [
				        {
				            type : 'value'
				        }
				    ],
				    series : [
				        {
				            name:["访问量"],
				            type:'bar',
				            barWidth: '60%',
				            data:zhuData,
				            itemStyle: {
				                normal: {
				                    color: function(params) {
				                        // build a color map as your need.
				                        var colorList = [
				                          '#C1232B','#B5C334','#FCCE10','#E87C25','#27727B'
				                        ];
				                        return colorList[params.dataIndex]
				                    }
				                }
				            },
				            label:{ 
				                normal:{ 
				                    show: true, 
				                    position: 'top'
				                    }
				            }
				        }
				    ]
				};
				 
				 
				if (option && typeof option === "object") {
				    hwChart.setOption(option, true);
            }
           }
                             /**************************************************
             * 功能：数据绘图(饼状图)
             * 函数名：Canvas3（）
             * 传入参数：无
             * 创建人：韩富攀 2017-10-24
             *************************************************/
        function Canvas7(jsonData,clientsName){
        	    var btn=[];
               var zhuData=[];
               for(var i=0;i<jsonData.length;i++){
               	     btn.push(jsonData[i].chapter);
               	     zhuData.push(jsonData[i].count);
               } 
               hwChart = echarts.init(document.querySelector('.main422'));
				var app = {};
				var option = null;
				app.title = '坐标轴刻度与标签对齐';
				option = {
				    color: ['#3398DB'],
				    tooltip : {
				        trigger: 'axis',
				        axisPointer : {            // 坐标轴指示器，坐标轴触发有效
				            type : 'shadow'        // 默认为直线，可选为：'line' | 'shadow'
				        }
				    },
				    legend: {
			             data:[]
			        },
//			        dataZoom: {
//					    show: true,
//					    realtime: true,
//					    x: 100,
//					    height: 20,
//					    start: 20,
//					    end: 80
//				    },
				    dataZoom: [
					{
						type: 'slider',
						show: true,
						realtime: true,
						xAxisIndex: [0],
						start: 0,
						end: 60
					},{
						type: 'inside',
						xAxisIndex: [0],
						start: 0,
						end: 60
					},
					],
				    grid: {
				        left: '3%',
				        right: '4%',
				        bottom: '12%',
				        containLabel: true
				    },
				    xAxis : [
				        {
				            type : 'category',
				            data : btn,
				            axisTick: {
				                alignWithLabel: true
				            }
				        }
				    ],
				    yAxis : [
				        {
				            type : 'value'
				        }
				    ],
				    series : [
				        {
				            name:["访问量"],
				            type:'bar',
				            barWidth: '60%',
				            data:zhuData,
				            itemStyle: {
				                normal: {
				                    color: function(params) {
				                        // build a color map as your need.
				                        var colorList = [
				                          '#C1232B','#B5C334','#FCCE10','#E87C25','#27727B'
				                        ];
				                        return colorList[params.dataIndex]
				                    }
				                }
				            },
				            label:{ 
				                normal:{ 
				                    show: true, 
				                    position: 'top'
				                    }
				            }
				        }
				    ]
				}; 
				if (option && typeof option === "object") {
				    hwChart.setOption(option, true);
            }
           }
            /**************************************************
             * 功能：数据绘图(饼状图)
             * 函数名：Canvas3（）
             * 传入参数：无
             * 创建人：韩富攀 2017-10-24
             *************************************************/
        function Canvas8(jsonData,clientsName){
        	    var btn=[];
               var zhuData=[];
               for(var i=0;i<jsonData.length;i++){
               	     btn.push(jsonData[i].chapter);
               	     zhuData.push(jsonData[i].score);
               } 
               hwChart = echarts.init(document.querySelector('.main423'));
				var app = {};
				var option = null;
				app.title = '坐标轴刻度与标签对齐';
				option = {
				    color: ['#3398DB'],
				    tooltip : {
				        trigger: 'axis',
				        axisPointer : {            // 坐标轴指示器，坐标轴触发有效
				            type : 'shadow'        // 默认为直线，可选为：'line' | 'shadow'
				        }
				    },
				    legend: {
			             data:[]
			       },
				    dataZoom: [
					{
						type: 'slider',
						show: true,
						realtime: true,
						xAxisIndex: [0],
						start: 0,
						end: 60
					},{
						type: 'inside',
						xAxisIndex: [0],
						start: 0,
						end: 60
					},
					],
				    grid: {
				        left: '3%',
				        right: '4%',
				        bottom: '12%',
				        containLabel: true
				    },
				    xAxis : [
				        {
				            type : 'category',
				            data : btn,
				            axisTick: {
				                alignWithLabel: true
				            }
				        }
				    ],
				    yAxis : [
				        {
				            type : 'value'
				        }
				    ],
				    series : [
				        {
				            name:["访问量"],
				            type:'bar',
				            barWidth: '60%',
				            data:zhuData,
				            itemStyle: {
				                normal: {
				                    color: function(params) {
				                        // build a color map as your need.
				                        var colorList = [
				                          '#C1232B','#B5C334','#FCCE10','#E87C25','#27727B'
				                        ];
				                        return colorList[params.dataIndex]
				                    }
				                }
				            },
				            label:{ 
				                normal:{ 
				                    show: true, 
				                    position: 'top'
				                    }
				            }
				        }
				    ]
				};
				if (option && typeof option === "object") {
				    hwChart.setOption(option, true);
            }
          }
          function _loadData(){
        	    var dataMenu='';
		 		var _success = function(json) {
		          	var jsonData = JSON.parse(json);
			        if (jsonData.status === 200) {
			          	var data = jsonData.data;
			          	dataMenu = data;
			        } else{
			          		
			        } 
		    	}
		 		var parms ={
		   	 		'bookID':'12619',
		   	 		'SessionKey':'F180C1E427C4D3F9573BFB34875E4DFA'
		 		}

		   	 	G_AjaxApi_Record.post('/api/kStenography/getBookChapterlist',parms, false, _success);// 考点速记_章节列表
			 	return dataMenu;
	      }
         function _loadData2(){
          	    var dataMenu='';
		 		var _success = function(json) {
		          	var jsonData = JSON.parse(json);
			        if (jsonData.status === 200) {
			          	var data = jsonData.data;
			          	dataMenu = data;
			        } else{
			          		
			        } 
		    	}
		 		var parms ={
		   	 		'appEName':'ZY_ZYAO_YTMJ',
		   	 		'SessionKey':'F180C1E427C4D3F9573BFB34875E4DFA'
		 		}

		   	 	G_AjaxApi_Record.post('/api/kStenography/getAppBooklist',parms, false, _success);// 考点速记_章节列表
			 	return dataMenu;
	      }
          var  indexChapter=_loadData();
          for(var i=0;i<indexChapter.length;i++){
          	  ulist = '<span id='+i+' title='+indexChapter[i].ChapterName+'>'+indexChapter[i].ChapterName+'</span>';
			  $('.select1_zhang li').append(ulist);
			  $('.select2_zhang li').append(ulist);
			  $('.select2s_zhang li').append(ulist);
			  $('.select3_zhang li').append(ulist);
			  $('.select4_zhang li').append(ulist);
			  $('.select5_zhang li').append(ulist);
          }
          /*每节的点击次数*/
	        $(document).on('click','.select1_zhang div',function(event){
	    		event.stopPropagation();
	    	    zhang(this);
	    	})
        	$(document).on('click','.select1_zhang li span',function(event){
	    		event.stopPropagation();
			    xuanze(this);
			    shortHandData2('节',$(this).attr('title'),'')
		    })  
		    /*每节的点击次数*/
	        $(document).on('click','.select2_zhang div',function(event){
	    		event.stopPropagation();
	    	    zhang(this);
	    	})
	        $(document).on('click','.select2_zhang li span',function(event){
	    		event.stopPropagation();
			    xuanze(this);
			    shortHandData3('节分数',$(this).attr('title'),'');
		    })  
		     /*每节的点击次数*/
	        $(document).on('click','.select2s_zhang div',function(event){
	    		event.stopPropagation();
	    	    zhang(this);
	    	})
	        $(document).on('click','.select2s_zhang li span',function(event){
	    		event.stopPropagation();
			    xuanze(this);
			    shortHandData3s('节测试',$(this).attr('title'),'');
		    })  
		    /*每节的点击次数*/
	        $(document).on('click','.select3_zhang div',function(event){
	    		event.stopPropagation();
	    	    zhang(this);
	    	})
	        $(document).on('click','.select3_zhang li span',function(event){
	    		event.stopPropagation();
			    xuanze(this);
			    addData1($(this).attr('id'),'.select32_zhang li');
		    })  
	        $(document).on('click','.select32_zhang div',function(event){
	    		event.stopPropagation();
	    	    zhang(this);
	    	})
        	$(document).on('click','.select32_zhang li span',function(event){
	    		event.stopPropagation();
			    xuanze(this);
			    shortHandData4('考点',$('.select3_zhang div p').attr('title'),$(this).attr('title'));
		    })  
	        /*每节的点击次数*/
	        $(document).on('click','.select4_zhang div',function(event){
	    		event.stopPropagation();
	    		zhang(this);
	    	})
	        $(document).on('click','.select4_zhang li span',function(event){
	    		event.stopPropagation();
			    xuanze(this);
			    addData1($(this).attr('id'),'.select42_zhang li');
		    }) 
	        $(document).on('click','.select42_zhang div',function(event){
	    		event.stopPropagation();
	    		zhang(this);
	    	})
	         $(document).on('click','.select42_zhang li span',function(event){
	    		event.stopPropagation();
			    xuanze(this);
			    shortHandData5('考点测试',$('.select4_zhang div p').attr('title'),$(this).attr('title'));
		    }) 
		     /*每节的点击次数*/
	        $(document).on('click','.select5_zhang div',function(event){
	    		event.stopPropagation();
	    		zhang(this);
	    	})
	        $(document).on('click','.select5_zhang li span',function(event){
	    		event.stopPropagation();
			    xuanze(this);
			    addData1($(this).attr('id'),'.select52_zhang li');
		    })  
	        $(document).on('click','.select52_zhang div',function(event){
	    		event.stopPropagation();
	    		zhang(this);
	    	})
	        $(document).on('click','.select52_zhang li span',function(event){
	    		event.stopPropagation();
			    xuanze(this);
			    shortHandData6('考点分数',$('.select5_zhang div p').attr('title'),$(this).attr('title'));  
		    })  
			 function addData1(menuData,secondData){
	        	var menuChild = indexChapter[menuData].Childs;
	        	var ulist = '';
	        	$(secondData).html('');
	        	console.log(menuData,secondData)
	        	for(var i=0;i<menuChild.length;i++){
		        	if(menuChild.length <= 1){
		        	  var lastMenu =menuChild[0].Childs;  
	                  for(var j=0;j<lastMenu.length;j++){
				    	ulist = '<span id='+null+' title='+lastMenu[j].ChapterName+'>'+lastMenu[j].ChapterName+'</span>';
				    	$(secondData).append(ulist);
				      }	
				    }else{
     			    	$(secondData).parent('ul').find('p').html(menuChild[0].ChapterName);
				    	ulist = '<span id="'+i+'" title='+menuChild[i].ChapterName+'>'+menuChild[i].ChapterName+'</span>';
				    	$(secondData).append(ulist);
				    }
//				    if(menuData){menuClick(menuChild)}	
	        	}
	        	$(secondData).parent('ul').find('p').html('选择节');
	        }  	
	        //展开
	        function zhang(data){
	        	var liHeight=$(data).parent().find('li').find('span').length*34+'px';
	            if($(data).parent().find('li').css('height')=='1px'||$(data).parent().find('li')=='0px'){
	    			$(data).parent().find('li').css({'border':'1px solid #e0e0e0','border-top':'none','height':liHeight});
	    			$(data).parent().find('img').attr('src','../../img/packUp.png');
	    			if($(data).parent().find('li').find('span').length>=6){
	    		      $(data).parent().find('li').css({'overflow-y':'scroll','height':6*34+'px'})
	    			}
	    		}else{
	    		    $(data).parent().find('li').css({'height':'0px','border':'1px solid #fff','border-top':'none'});
	    		    $(data).parent().find('img').attr('src','../../img/spread.png');
	    		}
	    		for(var i=0;i<$('.panel-body4 span').length;i++){ //字符串截取
		       		var oSpan = $('.panel-body4 span').eq(i).html().substr(0,6)+'...';
		       		$('.panel-body4 span').eq(i).html(oSpan)
		       	}
	        }
	        //选择
	       	function xuanze(data){
		    	$(data).parents('ul').find('p').html($(data).html());
			    $(data).parents('ul').find('p').attr('id',$(data).attr('id'));
			    $(data).parents('ul').find('p').attr('appEname',$(data).attr('appEname'));
			    $(data).parents('ul').find('p').attr('title',$(data).attr('title'));
			    $(data).parents('ul').find('li').css({'height':'0px','border':'1px solid #fff','border-top':'none'});
				$(data).parents('ul').find('img').attr('src','../../img/spread.png');
		    }      
	       	for(var i=0;i<$('.panel-body3 span').length;i++){//字符串截取
	       		var oSpan = $('.panel-body3 span').eq(i).html().substr(0,6)+'...';
	       		$('.panel-body3 span').eq(i).html(oSpan)
	       	}

            /**************************************************
             * 功能：登录成功人数数据 /api/new/loginCount
             * 接口：https://tongji.ksbao.com:8003
             * 函数名：getLoginData（）
             * 传入参数：startDay    开始时间
             *         endDay      结束时间
             *         clients     所选单品
             *         userType    购买未购买[0未购买、1购买、2合计]
             * 创建人：刘淳昊 2017-03-20
             *************************************************/
            function getLoginData(){
                var val=$('#reservation').val().split(' - ');
                var startTime = val[0];
                var endTime = val[1];
                clients=[];
                
                $('.productL .selected').each(function(){
                	clients.push($(this).attr('id'));
                });
                $('.singleApp .selected').each(function(){
                	clients.push($(this).attr('id'));
                });
                getAll(startTime,endTime);
                var userType = $('.purchase-situation .selected').attr('id');
                var client = $('.productOne div p').attr('id');
                var dataType = $('.selectionL .selected').attr('name');
                var appEName=$('.productTwo div p').attr('id');
                var clientsData = JSON.stringify(clients);
                var clientsNameData = JSON.stringify(clientsName);
                //折线图
                var _url='/api/new/shortHandLine?startDay='+startTime+'&endDay='+endTime+'&appEName='+appenames+'&client='+'["zyyszcp"]'+'&dataType='+'1';
                G_AjaxApi.get(_url,false,function(json){
                var jsonData = JSON.parse(json);
                    if(jsonData.status ==200){
                        if(jsonData.data ==''){
                            G_Prg.alert('数据为空')
                        }else{
                        	$('.titleNum').empty();
                            var _data = jsonData.data;
                            var _data2 = jsonData.data.list;
                            var barKey=[];
							$.each(_data, function(key, val) {
								barKey.push(_data[key]);
							});
                            $('.loadingimg').hide();
                            Canvas1(_data,times,_data[0].data);
                        }

                    }else{
                    	console.log(jsonData.status)
                    }
                })
                //柱状图
                var _url2='/api/new/shortHandColumn?startDay='+startTime+'&endDay='+endTime+'&appEName='+appenames+'&location='+'考点速记';
                G_AjaxApi.get(_url2,false,function(json){
                var jsonData = JSON.parse(json);
                    if(jsonData.status ==200){
                        if(jsonData.data ==''){
                             G_Prg.alert('数据为空')
                        }else{
                        	$('.titleNum').empty();
                            var _data = jsonData.data;
                            var _data2 = jsonData.data.list;
                            var barKey=[];
							$.each(_data, function(key, val) {
								barKey.push(_data[key]);
							});
                            $('.loadingimg').hide();
                            Canvas2(_data,times);
                        }

                    }else{
                    	console.log(jsonData.status)
                    }
                })
                shortHandData('章','','');//每章的点击次数            
            }
            function shortHandData(menutype,chapter,section){
	            var val=$('#reservation').val().split(' - ');
		        var startTime = val[0];
		        var endTime = val[1];
            	//每章的点击次数
                var _url3='/api/new/shortHandDetail?startDay='+startTime+'&endDay='+endTime+'&appEName='+appenames+'&menutype='+menutype+'&chapter='+chapter+'&section='+section;
                G_AjaxApi.get(_url3,false,function(json){
                var jsonData = JSON.parse(json);
                    if(jsonData.status ==200){
                        if(jsonData.data ==''){
                            G_Prg.alert('数据为空')
                        }else{
                        	$('.titleNum').empty();
                            var _data = jsonData.data;
                            var _data2 = jsonData.data.list;
                            var barKey=[];
							$.each(_data, function(key, val) {
								barKey.push(_data[key]);
							});
                            $('.loadingimg').hide();
     						Canvas3(_data,times);
                        }

                    }else{
                    	console.log(jsonData.status)
                    }
                })
            }
            function shortHandData2(menutype,chapter,section){
            	var val=$('#reservation').val().split(' - ');
		        var startTime = val[0];
		        var endTime = val[1];
            	//每节的点击次数
                var _url3='/api/new/shortHandDetail?startDay='+startTime+'&endDay='+endTime+'&appEName='+appenames+'&menutype='+menutype+'&chapter='+chapter+'&section='+section;
                G_AjaxApi.get(_url3,false,function(json){
                var jsonData = JSON.parse(json);
                    if(jsonData.status ==200){
                        if(jsonData.data ==''){
                            G_Prg.alert('数据为空')
                        }else{
                        	$('.titleNum').empty();
                            var _data = jsonData.data;
                            var _data2 = jsonData.data.list;
                            var barKey=[];
							$.each(_data, function(key, val) {
								barKey.push(_data[key]);
							});
                            $('.loadingimg').hide();
     						Canvas4(_data,times);
                        }

                    }else{
                    	console.log(jsonData.status)
                    }
                })
            }
            function shortHandData3(menutype,chapter,section){
            	var val=$('#reservation').val().split(' - ');
		        var startTime = val[0];
		        var endTime = val[1];
            	//每节测试的平均分
                var _url3='/api/new/shortHandDetail?startDay='+startTime+'&endDay='+endTime+'&appEName='+appenames+'&menutype='+menutype+'&chapter='+chapter+'&section='+section;
                G_AjaxApi.get(_url3,false,function(json){
                var jsonData = JSON.parse(json);
                    if(jsonData.status ==200){
                        if(jsonData.data ==''){
                            G_Prg.alert('数据为空')
                        }else{
                        	$('.titleNum').empty();
                            var _data = jsonData.data;
                            var _data2 = jsonData.data.list;
                            var barKey=[];
							$.each(_data, function(key, val) {
								barKey.push(_data[key]);
							});
                            $('.loadingimg').hide();
     						Canvas5(_data,times);
                        }

                    }else{
                    	console.log(jsonData.status)
                    }
                })
            }
            function shortHandData3s(menutype,chapter,section){
            	var val=$('#reservation').val().split(' - ');
		        var startTime = val[0];
		        var endTime = val[1];
            	//每节测试的平均分
                var _url3='/api/new/shortHandDetail?startDay='+startTime+'&endDay='+endTime+'&appEName='+appenames+'&menutype='+menutype+'&chapter='+chapter+'&section='+section;
                G_AjaxApi.get(_url3,false,function(json){
                var jsonData = JSON.parse(json);
                    if(jsonData.status ==200){
                        if(jsonData.data ==''){
                             G_Prg.alert('数据为空')
                        }else{
                        	$('.titleNum').empty();
                            var _data = jsonData.data;
                            var _data2 = jsonData.data.list;
                            var barKey=[];
							$.each(_data, function(key, val) {
								barKey.push(_data[key]);
							});
                            $('.loadingimg').hide();
     						Canvas5s(_data,times);
                        }

                    }else{
                    	console.log(jsonData.status)
                    }
                })
            }
            function shortHandData4(menutype,chapter,section){
            	var val=$('#reservation').val().split(' - ');
		        var startTime = val[0];
		        var endTime = val[1];
            	//每节测试的平均分
                var _url3='/api/new/shortHandDetail?startDay='+startTime+'&endDay='+endTime+'&appEName='+appenames+'&menutype='+menutype+'&chapter='+chapter+'&section='+section;
                G_AjaxApi.get(_url3,false,function(json){
                var jsonData = JSON.parse(json);
                    if(jsonData.status ==200){
                        if(jsonData.data ==''){
                             G_Prg.alert('数据为空')
                        }else{
                        	$('.titleNum').empty();
                            var _data = jsonData.data;
                            var _data2 = jsonData.data.list;
                            var barKey=[];
							$.each(_data, function(key, val) {
								barKey.push(_data[key]);
							});
                            $('.loadingimg').hide();
     						Canvas6(_data,times);
                        }
                    }else{
                    	console.log(jsonData.status)
                    }
                })
            }
            function shortHandData5(menutype,chapter,section){
            	 var val=$('#reservation').val().split(' - ');
		        var startTime = val[0];
		        var endTime = val[1];
            	//每节测试的平均分
                var _url3='/api/new/shortHandDetail?startDay='+startTime+'&endDay='+endTime+'&appEName='+appenames+'&menutype='+menutype+'&chapter='+chapter+'&section='+section;
                G_AjaxApi.get(_url3,false,function(json){
                var jsonData = JSON.parse(json);
                    if(jsonData.status ==200){
                        if(jsonData.data ==''){
                            G_Prg.alert('数据为空')
                        }else{
                        	$('.titleNum').empty();
                            var _data = jsonData.data;
                            var _data2 = jsonData.data.list;
                            var barKey=[];
							$.each(_data, function(key, val) {
								barKey.push(_data[key]);
							});
                            $('.loadingimg').hide();
     						Canvas7(_data,times);
                        }
                    }else{
                    	console.log(jsonData.status)
                    }
                })
            }
            function shortHandData6(menutype,chapter,section){
            	var val=$('#reservation').val().split(' - ');
		        var startTime = val[0];
		        var endTime = val[1];
            	//每节测试的平均分
                var _url3='/api/new/shortHandDetail?startDay='+startTime+'&endDay='+endTime+'&appEName='+appenames+'&menutype='+menutype+'&chapter='+chapter+'&section='+section;
                G_AjaxApi.get(_url3,false,function(json){
                var jsonData = JSON.parse(json);
                    if(jsonData.status ==200){
                        if(jsonData.data ==''){
                            G_Prg.alert('数据为空')
                        }else{
                        	$('.titleNum').empty();
                            var _data = jsonData.data;
                            var _data2 = jsonData.data.list;
                            var barKey=[];
							$.each(_data, function(key, val) {
								barKey.push(_data[key]);
							});
                            $('.loadingimg').hide();
     						Canvas8(_data,times);
                        }
                    }else{
                    	console.log(jsonData.status)
                    }
                })
            }
        /**********************************************************
        * 功能：获取日期区间
        * ********************************************************/
         Date.prototype.format=function (){
		    var s='';
		    s+=this.getFullYear()+'-';          // 获取年份。
		    s+=(this.getMonth()+1)+"-";         // 获取月份。
		    s+= this.getDate();                 // 获取日。
		    return(s);                          // 返回日期。
		};
		function getAll(begin,end){
				times=[];
			    var ab = begin.split("-");
			    var ae = end.split("-");
			    var db = new Date();
			    db.setUTCFullYear(ab[0], ab[1]-1, ab[2]);
			    var de = new Date();
			    de.setUTCFullYear(ae[0], ae[1]-1, ae[2]);
			    var unixDb=db.getTime();
			    var unixDe=de.getTime();
			    for(var k=unixDb;k<=unixDe;){
				    times.push((new Date(parseInt(k))).format());
				    k=k+24*60*60*1000;
			    }
		}
      init();
      
    //分页
     var theTable = document.getElementById("table2");
     var totalPage = document.getElementById("spanTotalPage");
     var pageNum = document.getElementById("spanPageNum");
     var spanPre = document.getElementById("spanPre");
     var spanNext = document.getElementById("spanNext");
     var spanFirst = document.getElementById("spanFirst");
     var spanLast = document.getElementById("spanLast");
     var numberRowsInTable = theTable.rows.length;
     var pageSize = 8;
     var page = 1;
     //下一页
     function next() {
         hideTable();
         currentRow = pageSize * page;
         maxRow = currentRow + pageSize;
         if (maxRow > numberRowsInTable) maxRow = numberRowsInTable;
         for (var i = currentRow; i < maxRow; i++) {
             theTable.rows[i].style.display = '';
         }
         page++;


         if (maxRow == numberRowsInTable) { nextText(); lastText(); }
         showPage();
         preLink();
         firstLink();
     }


     //上一页
     function pre() {
         hideTable();
         page--;
         currentRow = pageSize * page;
         maxRow = currentRow - pageSize;
         if (currentRow > numberRowsInTable) currentRow = numberRowsInTable;
         for (var i = maxRow; i < currentRow; i++) {
             theTable.rows[i].style.display = '';
         }
         if (maxRow == 0) { preText(); firstText(); }
         showPage();
         nextLink();
         lastLink();
     }


     //第一页
     function first() {
         hideTable();
         page = 1;
         for (var i = 0; i < pageSize; i++) {
             theTable.rows[i].style.display = '';
         }
         showPage();
         preText();
         nextLink();
         lastLink();
     }

     //最后一页
     function last() {
         hideTable();
         page = pageCount();
         currentRow = pageSize * (page - 1);
         for (var i = currentRow; i < numberRowsInTable; i++) {
             theTable.rows[i].style.display = '';
         }
         showPage();
         preLink();
         nextText();
         firstLink();
     }

     function hideTable() {
         for (var i = 0; i < numberRowsInTable; i++) {
             theTable.rows[i].style.display = 'none';
         }
     }

     function showPage() {
         pageNum.innerHTML = page;
     }
     //总共页数
     function pageCount() {
         var count = 0;
         if (numberRowsInTable % pageSize != 0) count = 1;
         return parseInt(numberRowsInTable / pageSize) + count;
     }

     //显示链接
     function preLink() { spanPre.innerHTML = "<a href='javascript:pre();'>上一页</a>"; }
     function preText() { spanPre.innerHTML = "上一页"; }

     function nextLink() { spanNext.innerHTML = "<a href='javascript:next();'>下一页</a>"; }
     function nextText() { spanNext.innerHTML = "下一页"; }

     function firstLink() { spanFirst.innerHTML = "<a href='javascript:first();'>首页</a>"; }
     function firstText() { spanFirst.innerHTML = "首页"; }

     function lastLink() { spanLast.innerHTML = "<a href='javascript:last();'>末尾</a>"; }
     function lastText() { spanLast.innerHTML = "末尾"; }

     //隐藏表格
     function hide() {
         for (var i = pageSize; i < numberRowsInTable; i++) {
             theTable.rows[i].style.display = 'none';
         }

         totalPage.innerHTML = pageCount();
         pageNum.innerHTML = '1';
         nextLink();
         lastLink();
     }
     hide();